home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / and.z / and
Encoding:
Text File  |  2002-10-03  |  4.2 KB  |  103 lines

  1. AND(3I)                                               Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      AANNDD - Computes logical product
  6.  
  7. SSYYNNOOPPSSIISS
  8.      AANNDD (([II==]_i,,[JJ==]_j))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran extension
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      AANNDD is an elemental function.  It accepts the following arguments:
  20.  
  21.      _i         Must be of type Boolean, integer, real, Cray pointer, or
  22.                logical.
  23.  
  24.      _j         Must be of type Boolean, integer, real, Cray pointer, or
  25.                logical.
  26.  
  27. NNOOTTEESS
  28.      AANNDD is an outmoded routine.  Refer to the _F_o_r_t_r_a_n _L_a_n_g_u_a_g_e _R_e_f_e_r_e_n_c_e
  29.      _M_a_n_u_a_l, _V_o_l_u_m_e _3, for information about outmoded features and their
  30.      preferred standard alternatives.  The name of this intrinsic cannot be
  31.      passed as an argument.
  32.  
  33. CCAAUUTTIIOONNSS
  34.      Unexpected results can occur when Boolean functions are declared
  35.      external and then used with logical arguments.  The external Boolean
  36.      functions always treat their arguments as type Boolean and return a
  37.      Boolean result on UNICOS and UNICOS/mk systems.  On IRIX systems, they
  38.      return an integer result.
  39.  
  40. RREETTUURRNN VVAALLUUEESS
  41.      When given two arguments of type logical, AANNDD computes a logical
  42.      product and returns a logical result.
  43.  
  44.      When given two arguments of type Boolean, integer, real, or pointer,
  45.      AANNDD computes a bit-wise logical product and returns a Boolean result
  46.      (on UNICOS and UNICOS/mk systems) or an integer result (on IRIX
  47.      systems).
  48.  
  49.      The following tables show both the logical product and bit-wise
  50.      logical product:
  51.  
  52.      ---------------------------------------------------------------------
  53.         Logical        Logical             (Logical Variable 1) AANNDD
  54.       Variable 1     Variable 2              (Logical Variable 2)
  55.      ---------------------------------------------------------------------
  56.            T              T                           T
  57.            T              F                           F
  58.            F              T                           F
  59.            F              F                           F
  60.      ---------------------------------------------------------------------
  61.  
  62.      ------------------------------------------------------------------
  63.         Bit of        Bit of            (Bit of Variable 1) AANNDD
  64.       Variable 1    Variable 2            (Bit of Variable 2)
  65.      ------------------------------------------------------------------
  66.           1             1                          1
  67.           1             0                          0
  68.           0             1                          0
  69.           0             0                          0
  70.      ------------------------------------------------------------------
  71.  
  72. EEXXAAMMPPLLEESS
  73.      The following section of Fortran code shows the AANNDD function used with
  74.      two arguments of type logical:
  75.  
  76.           LOGICAL L1, L2, L3
  77.           ...
  78.           L3 = AND(L1,L2)
  79.  
  80.      The following section of Fortran code shows the AANNDD function used with
  81.      two arguments of type integer.  The bit patterns of the arguments and
  82.      result are also given.  For clarity, only the rightmost 8 bits are
  83.      shown.
  84.  
  85.       INTEGER I1, I2, I3
  86.       I1 = 12
  87.       I2 = 10
  88.       ...
  89.       I3 = AND(I1,I2)
  90.        -------------------------------     -------------------------------
  91.       | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |   | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
  92.        -------------------------------     -------------------------------
  93.                         I1                               I2
  94.  
  95.                         -------------------------------
  96.                        | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
  97.                         -------------------------------
  98.                                         I3
  99.  
  100. SSEEEE AALLSSOO
  101.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  102.      man page.
  103.